"""
This code should run in windows OS.

for it use pywin32com.

The windows computer should have installed 
Word and MathType first.

"""

from pywin32com import client

word=client.Dispatch("Word.Application")
word.Visible=True


# 加载mathtype2omath.dotm 模板
# you should change the template_path
template_path = 'C:\\path_to_template\\template.dotm'
word.AttachedTemplate = template_path

# 打开需要将mathtype转为omath的docx 文件
# you should change the template_path
doc_path = 'C:\\path_to_document\\document.docx'
doc = word.Documents.Open(doc_path)


